/*
	Azid Engine is 3D Game Engine developed along side with Galactic Siege (see Google Code) 
	Copyright (C) 2010  Jorgen Ader

	This file is part of AzidEngine.

	AzidEngine is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	AzidEngine is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with AzidEngine.  If not, see <http://www.gnu.org/licenses/>. 
*/

#ifndef __SettingsManager_HPP__
#define __SettingsManager_HPP__

#include "Includes.hpp"

namespace AzidEngine
{
    /** 
     * \addtogroup ENGINE
     * @{
     * \addtogroup CORE
     * @{
     * \class SettingsManager
     * @{
     **/

    class SettingsManager
    {
    public:
    	// TODO fill in all settings
    	// and add to parsing
    	enum Settings
    	{
    		SCREEN_WIDTH = 0,
    		SCREEN_HEIGHT,
    		COLOR_DEPTH,
    		RENDERING_SYSTEM,
    		FULLSCREEN,
    		ANTI_ALIASING,
    		VSYNC,
    		NVPREF_HUD,
    		sRGB_CONVERSION,
    		FLOATING_POINT,
    		LOV,
    		UI_SKIN,
    		RESOURCEFILE,
    		MOD_DIR
    	};
    protected:
	    Ogre::String 							mFileName;
	    HashMap< Settings, Ogre::String >		mSettings;
	    bool 									mChanged;

    public:

	    /**
	     * SettingsManager constructor
	     * @param fileName
	     */
	    SettingsManager( Ogre::String filename = "settings.cfg" );

	    /**
	     * SettingsManager destructor
	     **/
	    ~SettingsManager();
	    
	    /**
	     * Set's Settings FileName
	     * @param fileName
	     */
	    void setFile( Ogre::String filename );

	    /** Returns previosly set settings value
	     * @param Setting
	     */
	    Ogre::String getValue( Settings Setting );
	    
	    /**
	     * Set's Setting to Value
	     * @param Setting
	     * @param Value
	     */
	    void setValue( Settings Setting, Ogre::String value );

	    /**
	     * Read's and parse's all settings from <i>mSettings</i> to memory
	     **/
	    bool Read();

	    /**
	     * Write's all settings from memory to <i>mSettings</i>
	     **/
	    void Write();
    };
    /** 
     * @}
     * @}
     * @}
     */
}
#endif
